﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace UtilsORM.MySqlData;

[Index("p_guid", Name = "idxdclguid")]
[Index("p_d_guid", Name = "idxdguid")]
[Index("p_execute_time", Name = "idxsendTime")]
[MySqlCharSet("utf8mb3")]
[MySqlCollation("utf8mb3_general_ci")]
public partial class iot_device_command_processing
{
    [Key]
    public long p_id { get; set; }

    public string p_guid { get; set; }

    public string p_d_guid { get; set; }

    /// <summary>
    /// 执行内容
    /// </summary>
    public string p_content { get; set; }

    /// <summary>
    /// 执行key
    /// </summary>
    [StringLength(50)]
    public string p_key { get; set; }

    /// <summary>
    /// 指令名称
    /// </summary>
    [StringLength(255)]
    public string p_name { get; set; }

    [StringLength(100)]
    public string p_status_remark { get; set; }

    /// <summary>
    /// 发送指令的人
    /// </summary>
    [StringLength(255)]
    public string p_user_name { get; set; }

    /// <summary>
    /// 发送指令人的IP
    /// </summary>
    [StringLength(255)]
    public string p_user_remote_ip { get; set; }

    /// <summary>
    /// 0待执行,1处理中，2回调成功，3异常,4已发送mq,5mq发送失败
    /// </summary>
    public int? p_status { get; set; }

    [StringLength(255)]
    public string p_user_guid { get; set; }

    [StringLength(50)]
    public string p_mqevent { get; set; }

    /// <summary>
    /// 协议
    /// </summary>
    [StringLength(50)]
    public string p_agreement_type { get; set; }

    [StringLength(100)]
    public string p_device_remark { get; set; }

    /// <summary>
    /// 设备id
    /// </summary>
    [StringLength(255)]
    public string p_gateway_code { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime p_add_time { get; set; }

    /// <summary>
    /// 设备型号
    /// </summary>
    [StringLength(255)]
    public string p_device_model_code { get; set; }

    /// <summary>
    /// 发送时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? p_execute_time { get; set; }

    /// <summary>
    /// 网关设备ID
    /// </summary>
    [StringLength(50)]
    public string p_gateway_deviceguid { get; set; }

    /// <summary>
    /// 参数
    /// </summary>
    [StringLength(1000)]
    public string p_parameter { get; set; }

    /// <summary>
    /// 运行组
    /// </summary>
    [StringLength(50)]
    public string p_group_guid { get; set; }

    /// <summary>
    /// 重复执行次数
    /// </summary>
    public int? p_repeat_count { get; set; }

    /// <summary>
    /// 毫秒，最大支持864000000，约10天
    /// </summary>
    public int? p_repeat_count_interval { get; set; }

    /// <summary>
    /// 来源
    /// </summary>
    [StringLength(255)]
    public string p_source { get; set; }
}
